package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;

/**
 * 第三方托管账户金额信息
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "tpp_account")
public class TppAccount {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 用户ID */
    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;

    /** 余额/基金份额 */
    private double balance;

    /** 可用余额/基金份额 */
    private double availableBalance;

    /** 冻结总额 */
    private double noUseMoney;

    /** 昨日存钱罐收益 */
    private double yesterdayBonus;

    /** 最近一月存钱罐收益 */
    private double latestMonthBonus;

    /** 总存钱罐收益 */
    private double totalBonus;

    /** 更新时间 */
    private Date updateTime;

    public TppAccount() {
        super();
    }

    public TppAccount(User user) {
        super();
        this.user = user;
    }

    /**
     * 获取主键
     *
     * @return 主键
     */
    public long getId() {
        return id;
    }

    /**
     * 设置主键
     *
     * @param id 要设置的主键
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * 获取用户ID
     *
     * @return 用户ID
     */
    public User getUser() {
        return user;
    }

    /**
     * 设置用户
     *
     * @param user 要设置的用户
     */
    public void setUser(User user) {
        this.user = user;
    }

    /**
     * 获取余额
     *
     * @return balance 余额
     */
    public double getBalance() {
        return balance;
    }

    /**
     * @param balance 要设置的 balance
     */
    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getAvailableBalance() {
        return availableBalance;
    }

    public void setAvailableBalance(double availableBalance) {
        this.availableBalance = availableBalance;
    }

    public double getNoUseMoney() {
        return noUseMoney;
    }

    public void setNoUseMoney(double noUseMoney) {
        this.noUseMoney = noUseMoney;
    }

    public double getYesterdayBonus() {
        return yesterdayBonus;
    }

    public void setYesterdayBonus(double yesterdayBonus) {
        this.yesterdayBonus = yesterdayBonus;
    }

    public double getLatestMonthBonus() {
        return latestMonthBonus;
    }

    public void setLatestMonthBonus(double latestMonthBonus) {
        this.latestMonthBonus = latestMonthBonus;
    }

    public double getTotalBonus() {
        return totalBonus;
    }

    public void setTotalBonus(double totalBonus) {
        this.totalBonus = totalBonus;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
